package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.service.AccountService;

/**
 * @author cp
 * @className AccountServiceImpl
 * @description TODO
 * @create 2020/12/8 19:17
 **/
public class AccountServiceImpl implements AccountService {
    private AccountDao accountDao;

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public void transfer(String outName, String inName, Double money) {

        accountDao.inMoney(outName,money);
//        int a = 1/0;          // 模拟业务层事务过程中出现错误
        accountDao.outMoney(inName,money);

    }
}
